package com.example.lib_core.init;

import android.app.Application;

import com.alibaba.android.arouter.launcher.ARouter;

public class Core {
    private Application application;
    private boolean isDebug=true;

    public void setDebug(boolean debug) {
        isDebug = debug;
    }

    public Application getApplication() {
        return application;
    }
    //初始化
    public void init(Application application){
        this.application=application;
        initARouter();
    }
    //初始化路由器
    public void initARouter(){
        if(isDebug){
            ARouter.openDebug();
            ARouter.openLog();
        }
        ARouter.init(application);
    }


    private static Core core;
    public static Core getInstance(){
        if(core==null){
            core=new Core();
        }
        return core;
    }

}
